<!DOCTYPE html>
<html lang="<%= I18n.locale %>">
  <head>
    <%= tag :meta, charset: "utf-8" %>
    <title><%= t(".title", resource_title: resource.presenter.title(html_escape: true)) %></title>
    <%= stylesheet_pack_tag "decidim_qr", media: "all" %>
    <%= csrf_meta_tags %>
    <%= csp_meta_tag %>
  </head>
  <body>
    <h1><%= resource.presenter.title(html_escape: true) %></h1>

    <% if resource.respond_to?(:attachments) && resource.attachments.first&.url %>
      <div class="card__grid-img">
        <%= image_tag resource.attachments.first&.url, alt: resource.presenter.title(html_escape: true) %>
      </div>
    <% end %>

    <h3><%= t(".scan") %></h3>
    <div>
      <img src="data:;base64,<%= qr_code_image %>" alt="<%= t(".title", resource_title: resource.presenter.title(html_escape: true) ) %>" class="code-qr">
    </div>

    <div class="logo">
      <%= render partial: "layouts/decidim/logo", locals: { organization: current_organization } %>
    </div>
  </body>
</html>
